help(){
  echo "    ""ARG1: File path"
  echo "    ""ARG2: File path"
  echo "    ""ARG3: (Optional) Output path"
  exit 1
}

[[ $# -eq 0 ]] && help
Output=/dev/null
File1=$1
File2=$2
[[ $# -eq 3 ]] && Output=$3

Content1=$(hexdump $File1 -v -e '/1 "%02x "')
Content2=$(hexdump $File2 -v -e '/1 "%02x "')

if [ ${#Content1} -gt ${#Content2} ] ; then
  echo "$Content1" | grep --color "$Content2" > $Output
else
  echo "$Content2" | grep --color "$Content1" > $Output
fi

ret=$?
echo -n "Match: "
[[ $ret -eq 0 ]] && echo "True" || echo "False"
exit $ret
